home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Development / AmigaTalk_X / intuition / SetupIntuition.st < prev    next >
Encoding:
Text File  |  2002-03-13  |  3.0 KB  |  111 lines

  1. " ------------------------------------------------------------------- "
  2. " Intuition Class is a Singleton class that allows the user to        "
  3. " reference intuition-specific singleton classes in one spot.         "
  4. ""
  5. " ALL singleton classes MUST contain the following:                   "
  6. ""
  7. "   the methods:  isSingleton AND privateSetup     AND                "
  8. "                 uniqueInstance Class instance variable.             "
  9. " ------------------------------------------------------------------- "
  10.  
  11. Class Intuition :Dictionary 
  12. ! uniqueInstance gadgetAttrs     gadgetFlags gadgetTypes gadToolsAttrs
  13.   gadgetActs     gadgetMethodIDs idcmpFlags  screenTags  windowFlags 
  14.   windowTags     specialTags     icClass     methodIDs   imageTags
  15.   menuFlags      reqFlags        boopsiNames
  16. !
  17. [
  18.    isSingleton
  19.      ^ true  
  20. |  
  21.    privateNew ! newInstance !
  22.      newInstance <- super new.
  23.      ^ newInstance
  24. |
  25.    new
  26.      ^ (self privateSetup)
  27. |
  28.    privateSetup
  29.      (uniqueInstance isNil)
  30.        ifTrue: [uniqueInstance  <- self privateNew.
  31.                 
  32.                 specialTags     <- SpecialTags new.
  33.  
  34.                 "BOOPSI tag singleton classes:"
  35.                 icClass         <- ICClass          new.
  36.                 methodIDs       <- MethodIDs        new.
  37.                 imageTags       <- ImageTags        new.
  38.                 boopsiNames     <- BoopsiClassNames new.
  39.  
  40.                 "Initialize all Intuition Singleton classes:"
  41.                 gadToolsAttrs   <- GadToolsAttributes new.
  42.  
  43.                 gadgetAttrs     <- GadgetAttributes new.
  44.                 gadgetMethodIDs <- GadgetMethodIDs  new.
  45.                 gadgetFlags     <- GadgetFlags      new.
  46.                 gadgetTypes     <- GadgetTypes      new.
  47.                 gadgetActs      <- GadgetActivation new.
  48.  
  49.                 screenTags      <- ScreenTags       new.
  50.                 windowTags      <- WindowTags       new.
  51.                 windowFlags     <- WindowFlags      new.
  52.                 idcmpFlags      <- IDCMPFlags       new.
  53.                 menuFlags       <- MenuFlags        new.
  54.                 reqFlags        <- RequesterFlags   new.
  55.                ].
  56.  
  57.      ^ self "uniqueInstance??"
  58. |
  59.    boopsiClassName: key
  60.      ^ boopsiNames at: key
  61. |
  62.    requesterFlag: key
  63.      ^ reqFlags at: key
  64. |
  65.    menuFlag: key
  66.      ^ menuFlags at: key
  67. |
  68.    specialTag: key
  69.      ^ specialTags at: key
  70. |
  71.    imageTag: key
  72.      ^ imageTags at: key
  73. |
  74.    icClass: key
  75.      ^ icClass at: key
  76. |
  77.    methodIDs: key
  78.      ^ methodIDs at: key
  79. |
  80.    getGadgetAttr:  key
  81.      ^ gadgetAttrs at: key
  82. |
  83.    getGadToolAttr: key
  84.      ^ gadToolsAttrs at: key
  85. |
  86.    getGadgetFlag:  key
  87.      ^ gadgetFlags at: key
  88. |
  89.    getGadgetType:  key
  90.      ^ gadgetTypes at: key
  91. |
  92.    getGadgetMethodID:  key
  93.      ^ gadgetMethodIDs at: key
  94. |
  95.    getGadgetActivation:  key
  96.      ^ gadgetActs at: key
  97. |
  98.    getScreenTag:   key
  99.      ^ screenTags at: key
  100. |
  101.    getWindowTag:   key
  102.      ^ windowTags at: key
  103. |
  104.    getIDCMPFlag:   key
  105.      ^ idcmpFlags at: key
  106. |
  107.    getWindowFlag:  key
  108.      ^ windowFlags at: key
  109. ]
  110.  
  111.